﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ScrumTime.Models;
using ScrumTime.Helpers;
using System.Data.Objects.DataClasses;

namespace ScrumTime.ViewModels
{
    public class StoryViewModel
    {
        public Story StoryModel { get; set; }
        public List<int> Points { get; private set; }
        public List<Sprint> AllSprints { get; set; }

        //-------codigo insertado
        public List<UsabilityFeature> AllUsabilityFeatures { get; private set; }

        public bool isUsabilityFeatureSelect(UsabilityFeature u, EntityCollection<UsabilityFeature> ufs ) {
            bool resultado = false;

            foreach (UsabilityFeature uf in ufs)
            {
                if (u.UsabilityFeatureId == uf.UsabilityFeatureId) {
                    resultado = true;
                    break;
                }
            }

            return resultado;
        }
        //-------fin de codigo insertado

        public StoryViewModel()
        {
            Points = StoryPoints.All();
            AllUsabilityFeatures = UsabilityFeatures.All();
        }


        
    }


}